package com.kelvin.paopao.api;

import android.content.Context;

import com.kelvin.kelvinlib.utils.ToastUtil;
import com.kelvin.paopao.utils.DialogMaker;

import io.reactivex.annotations.NonNull;
import io.reactivex.functions.Consumer;

/**
 * Created by MCK on 2017/5/13.
 * 网络错误的处理器
 */

public class ThrowableConsumer implements Consumer<Throwable> {
    private Context context;

    public ThrowableConsumer(Context context) {
        this.context = context;
    }

    @Override
    public void accept(@NonNull Throwable throwable) throws Exception {
//        ToastUtil.showToast(context, "网络错误，请稍候~~");
        DialogMaker.diamiss();
    }
}
